class GameStats():
    """跟踪游戏的统计信息"""

    def __init__(self, ai_settings) -> None:
        self.ai_settings = ai_settings
        # 游戏启动时处于活动状态
        self.game_active = False
        # 在任何情况下都不应重置最高分
        self.high_score = 0
        self.reset_stats()

    def reset_stats(self):
        self.ships_left = self.ai_settings.ship_limit
        self.score = 0
        self.level = 1

